# coding: UTF-8
# ----------
# Project_Name : pythonProject
# File_Name : huangcongbing
# Author : asus
# Date_Time:2022/4/22 14:47
# Description :
# ----------
from selenium import  webdriver
import time
from selenium.webdriver.common.by import By
"""
单选框radiodbox和复选框checkbox的选择直接点，注意一下点击范围
"""
def foo1():
    driver = webdriver.Chrome()
    driver.maximize_window()

    driver.get(r"D:\pyworkspace\T79\pythonProject\selenium3\example.html")

    is_selected = driver.find_element(By.ID,'web').is_selected()#判断元素是否被选中,注意命名方式，is开头的一般为判断
    print(is_selected)#返回布尔值

    driver.find_element(By.ID,'web').click()  #勾选复选框
    is_selected = driver.find_element(By.ID, 'web').is_selected()  # 判断元素是否被选中
    print(is_selected)
    time.sleep(2)



    driver.quit()
if __name__ == "__main__":
        foo1()